package com.atguigu.system;


import com.atguigu.system.utils.JwtHelper;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Random;
import java.util.Scanner;

//@SpringBootTest
public class AutoCode {

    @Test
    public void test01() {
        String token = JwtHelper.createToken("1", "admin");
//        System.out.println(token);

        String userId = JwtHelper.getUserId(token);
        System.out.println(userId);
    }

    @Test
    public void test02() {
        Random random = new Random();
        int randInt = random.nextInt(100);
        Scanner scanner = new Scanner(System.in);
        while (true) {
            int i = scanner.nextInt();
            if(i < randInt) {
                System.out.println("猜小了");
            } else if(i > randInt) {
                System.out.println("猜大了");
            } else {
                System.out.println("恭喜你猜对了");

            }
        }
    }
}
